<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>Dashboard Template for Bootstrap</title>
		<!-- Bootstrap core CSS -->
		<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
		<link th:href="@{/css/bootstrap-datetimepicker.min.css}" rel="stylesheet">
		<!-- Custom styles for this template -->
		<link th:href="@{/css/dashboard.css}" rel="stylesheet">
		<link href="https://cdn.bootcdn.net/ajax/libs/limonte-sweetalert2/6.6.2/sweetalert2.min.css" rel="stylesheet">
		<style type="text/css">
			/* Chart.js */
			
			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}
		</style>
	</head>

	<body>
		<!--顶部导航栏-->
		<div th:replace="~{commons/commons::topbar}"></div>

		<div class="container-fluid">
			<div class="row">
				<!--将侧边栏抽取为公共部分-->
				<div th:replace="~{commons/commons::sidebar(active='user/list.html')}"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<form id="userForm" name="userForm" th:action="@{/user/userUpdate}" method="post" class="form-horizontal offset-4">
						<input type="hidden" name="id" th:value="${user.getId()}">
						<div class="form-group col-sm-6">
							<label>编码</label>
							<input type="text" class="form-control" name="userCode" id="userCode" th:value="${user.getUserCode()}">
						</div>
						<div class="form-group col-sm-6">
							<label>姓名</label>
							<input type="text" class="form-control" name="userName" id="userName" th:value="${user.getUserName()}">
						</div>
						<div class="form-group col-sm-6">
							<label>性别</label><br>
							<div class="form-check form-check-inline">
								<input  th:checked="${user.getGender()==1}" class="form-check-input" type="radio" name="gender" value="1">
								<label class="form-check-label">男</label>
							</div>
							<div class="form-check form-check-inline">
								<input th:checked="${user.getGender()==2}" class="form-check-input" type="radio" name="gender"  value="2">
								<label class="form-check-label">女</label>
							</div>
						</div>
						<div class="form-group col-sm-6">
							<label class="control-label">出生日期</label><br>
							<input class="form-control" id="datetimeStart"  th:value="${user.getBirthday()}" name="birthday">
						</div>
						<div class="form-group col-sm-6">
							<label>电话</label>
							<input class="form-control" name="phone" id="phone" th:value="${user.getPhone()}">
						</div>
						<div class="form-group col-sm-6">
							<label>地址</label>
							<textarea class="form-control" name="address" id="address" th:text="${user.getAddress()}"></textarea>
						</div>
						<div>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="button" class="btn btn-primary" id="save">修改</button>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="button" name="back" onclick="toUserList()" class="btn btn-warning">返回</button>
						</div>
					</form>
				</main>
			</div>
		</div>

		<!-- Bootstrap core JavaScript
    ================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
		<script type="text/javascript" th:src="@{/js/popper.min.js}"></script>
		<script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script>
		<script type="text/javascript" th:src="@{/js/bootstrap-datetimepicker.zh-CN.js}"></script>
		<script type="text/javascript" th:src="@{/js/bootstrap-datetimepicker.js}"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/limonte-sweetalert2/6.6.2/sweetalert2.min.js"></script>
		<script type="text/javascript" th:src="@{/js/userModify.js}"></script>

		<!--birthday时间控件设置-->
		<script type="text/javascript">
			$.fn.datetimepicker.dates['zh-CN'] = {
				days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
				daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
				daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
				months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
				monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
				today: "今天",
				suffix: [],
				meridiem: ["上午", "下午"]
			};
			$('#datetimeStart').datetimepicker({
				format: 'yyyy-mm-dd',  //显示格式可为yyyymm/yyyy-mm-dd/yyyy.mm.dd
				weekStart: 1,  	//0-周日,6-周六 。默认为0
				autoclose: true,
				startView: 4,  	//打开时显示的视图。0-'hour' 1-'day' 2-'month' 3-'year' 4-'decade'
				minView: 2,  	//最小时间视图。默认0-'hour'
				maxView: 4, 	//最大时间视图。默认4-'decade'
				todayBtn:true, 	//true时"今天"按钮仅仅将视图转到当天的日期。如果是'linked'，当天日期将会被选中。
				todayHighlight:true,	//默认值: false,如果为true, 高亮当前日期。
				initialDate: new Date(),	//初始化日期.默认new Date()当前日期
				forceParse: false,  	//当输入非格式化日期时，强制格式化。默认true
				bootcssVer:4,	//显示向左向右的箭头
				language: 'zh-CN' //语言
			});
		</script>

		<!--返回按钮-->
		<script>
			function toUserList() {
				history.back(-1);
			}
		</script>

		<!-- Icons -->
		<script type="text/javascript" th:src="@{/js/feather.min.js}"></script>
		<script>
			feather.replace()
		</script>

		<!-- Graphs -->
		<script type="text/javascript" th:src="@{/js/Chart.min.js}"></script>
		<script>
			var ctx = document.getElementById("myChart");
			var myChart = new Chart(ctx, {
				type: 'line',
				data: {
					labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
					datasets: [{
						data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
						lineTension: 0,
						backgroundColor: 'transparent',
						borderColor: '#007bff',
						borderWidth: 4,
						pointBackgroundColor: '#007bff'
					}]
				},
				options: {
					scales: {
						yAxes: [{
							ticks: {
								beginAtZero: false
							}
						}]
					},
					legend: {
						display: false,
					}
				}
			});
		</script>

	</body>

</html>